﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Cypher.Core.Managers
{
	public class CypherManager
	{
		#region Methods

		/// <summary>
		/// Entrypoint of the DocumentationManager registring and calling methods to gather the documentation
		/// </summary>
		public static void UseApiDocumentation(Cypher.Core.Configuration.CypherConfiguration configuration)
		{
			
			//Type serviceType = Type.GetType(configuration.Service.Type);
			//if (serviceType == null)
			//	return; // TODO: log this as warning if the configuration did not match or holds error(s)



			//// patch for removing the default controller suffix convention so i can use my own flavor of "ApiControllers"
			//var suffix = typeof(System.Web.Http.Dispatcher.DefaultHttpControllerSelector).GetField("ControllerSuffix", BindingFlags.Static | BindingFlags.Public);
			//if (suffix != null) suffix.SetValue(null, string.Empty);

			//var resolver = new CypherHttpControllerTypeResolver(true);
			//config.Services.Replace(typeof(System.Web.Http.Dispatcher.IHttpControllerTypeResolver), resolver);

		}

		public static void UseApiDocumentation(System.Web.Http.Description.IDocumentationProvider documentationProvider)
		{ 
		}

		// TODO: Evaluate if i can use the OWIN Middleware approch instead of the System.Web.PreApplicationStartMethod
		//public static void UseApiDocumentation(this IAppBuilder app)
		//{
		// TODO: register the documentation
		//}

		#region Private Methods

		#endregion

		#endregion
	}
}
